/*
 * @Author: weikang
 * @Description:
 * @Date: 2024-02-08 16:50:25
 * @LastEditTime: 2024-06-05 22:39:19
 * @FilePath: \env-manager-pc\src\api\modules\ele.statistics.ts
 */
import api, { requestAllBack } from '../index'

export default {
  // 获取设备日电量
  GetElectricityDay: (data: { deviceObjIDs: any[], startTime: string, endTime: string }) => api<any>({
    url: `/Electric/GetElectricityDay`,
    method: 'post',
    data,
  }),
  // 获取设备月电量
  GetElectricityMonth: (data: { deviceObjIDs: any[], startTime: string, endTime: string }) => api<any>({
    url: `/Electric/GetElectricityMonth`,
    method: 'post',
    data,
  }),
  // 获取设备年电量
  GetElectricityYear: (data: {
    deviceObjIDs: string[]
    startTime: string
    endTime: string
  }) => api<any>({
    method: 'post',
    url: '/Electric/GetElectricityYear',
    data,
  }),
  // 导出日电量
  GetElectricityDayToExcel: (data: { deviceObjIDs: any[], startTime: string, endTime: string }) => requestAllBack({
    url: `/Electric/GetElectricityDayToExcel`,
    method: 'post',
    data,
    responseType: 'blob',
  }),
  // 导出月电量
  GetElectricityMonthToExcel: (data: { deviceObjIDs: any[], startTime: string, endTime: string }) => requestAllBack({
    url: `/Electric/GetElectricityMonthToExcel`,
    method: 'post',
    data,
    responseType: 'blob',
  }),
}
